<?php
	require_once(dirname(dirname(dirname(__FILE__))) . "/config.php");
	require_once(SAS_PATH . "_includes/classes/webservice/nusoap.php");
	
	function call($nm_serv, $array){
	
		$client = new nusoap_client(WS_ENDPOINT);
		
		$err = $client->getError();
		if ($err) {
			return false;
		}
		
		$result = $client->call($nm_serv, $array, '', '', false, true);
		
		// Check for a fault
		if ($client->fault) {
			return false;
		} else {
			// Check for errors
			$err = $client->getError();
			if ($err) {
				return false;
			} else {
				return $result;
			}
		}
	}
	
?>